﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cmd;

namespace cmd.Test
{
    class Options : OptionSet
    {
        [Option("b", "Represents a boolean, nullable value. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.", Required = true, DefaultValue = true, Alias = "b")]
        [OptionGroup("nullable_boolean", Required = true)]
        public bool? NullableBoolean { get; set; }

        [Option("c", "Represents a boolean value.", Name = "boolean", Alias = "c")]
        public bool CBoolean { get; set; }

        [Option("d", "Another boolean value", Alias = "d")]
        public bool DBoolean { get; set; }

        [Option("int", "integer, not nullable test.", Name = "integer_value", Alias = "i", Required = true)]
        [OptionGroup("int", Required = true)]
        [OptionGroup("array")]
        public int Integer { get; set; }

        [Option("string", "String value.", Name = "string_value", Alias = "s")]
        public string String { get; set; }

        [Option("e", "Enumeration value", Name = "enumeration", Alias = "e")]
        public TestEnum Enumeration { get; set; }

        [Option("a", "Array of strings", Name = "array", Alias = "a")]
        public string[] Array { get; set; }

        [Option("arr", "Array of integers", Name = "int_array", Alias = "arr")]
        [OptionGroup("int", Required = true)]
        public int[] IntArray { get; set; }

        [Option("l", "A list of integer values", Name = "int_list")]
        public List<int> List { get; set; }

        [Option("dummy", "A string value", Name = "dummy string", DefaultValue = "")]
        public string Dummy { get; set; }

        [Option("t", "A new type", Name = "dummy type")]
        public TestType TestT { get; set; }

        protected override string[] GetUsageScenarios()
        {
            List<string> list = new List<string>();

            list.Add("[l | a]");
            list.Add("[b | c]");

            return list.ToArray();
        }

        public override Cmd.TypeConverters.ITypeConverter[] GetCustomConverters()
        {
            return new Cmd.TypeConverters.ITypeConverter[1] { new TestConverter() };
        }
    }
}
